import type { DataTableProps } from "naive-ui";
import { NAvatar, NImage, NTag } from "naive-ui";
import { h } from "vue";
import RenderGender from "@/components/RenderGender.vue";
import { formatTime, renderMaybeNull } from "@/utils";
import { AUTH_TYPE_MAP, USER_AUTH_STATUS_MAP, USER_AUTH_STATUS_MAP_COLOR } from '@/const/user'

export const productColumns: DataTableProps["columns"] = [
	{
		title: '商品标题',
		key: 'title',
		width: 180
	},
	{
		title: '付款方式',
		key: 'payType',
		width: 120,
        render: item => item.payType === '10' ? '等额分段' : '一次性付款'
	},
	{
		title: '上架状态',
		key: 'status',
		width: 100,
		render: (row: any) => {
			return h(NTag, {
				type: row.status === 1 ? 'success' : 'error',
				round: true,
				size: 'small'
			}, {
				default: () => row.status === 1 ? '已上架' : '已下架'
			})
		}
	},
    {
        title: '商品售价',
        key: 'price',
        width: 120
    },
    {
        title: '原价',
        key: 'originalPrice',
        width: 120
    },
	{
		title: '创建时间',
		key: 'createTime',
		width: 180,
		render: (row: any) => row.createTime ? formatTime(row.createTime, 'YYYY-MM-DD HH:mm:ss') : '-'
	},
    {
        title: '更新时间',
        key: 'updateTime',
        width: 180,
        render: (row: any) => row.updateTime ? formatTime(row.updateTime, 'YYYY-MM-DD HH:mm:ss') : '-'
    },
    {
        title: '创建人',
        key: 'createBy',
        width: 120
    },
]


